import { Image, ScrollView, Swiper, SwiperItem, Text, View } from '@tarojs/components';
import Taro from '@tarojs/taro';
import React, { Component } from 'react';
import * as T from '../types';
import './myHouseMoney.less';
import actions from '../actions/index';
import { connect } from 'react-redux';
import { store2Props } from '../selectors';
import myhousemoneyBGIcon from '@/assets/image/index/myhousemoneyBG.png'
import testHouseIcon from '@/assets/image/index/testhouse.png'

type IHouseMoneyProps = T.IProps & T.IHouseMoneyProps;
//@ts-ignore
@connect<Partial<IHouseMoneyProps>, T.IHouseMoneyState>(store2Props, actions)
export default class Info extends Component<Partial<IHouseMoneyProps>, T.IHouseMoneyState> {
  constructor(props: IHouseMoneyProps) {
    super(props);
  }

  render() {
    let {
      main: { },
      actions: { action },
    } = this.props;
    return (
      <View className="PageIndexHouseMoney">
        <View className='content'>
          {/* <Image className='b_bg' mode="widthFix" src={bgIcon} /> */}
          <View className='t_box'>
            <View className='row'>
              <View
                style={{
                  height: '16px',
                  width: '5px',
                  backgroundColor: '#218CFF',
                  marginRight: '10px',
                }}></View>
              <Text className='l_title'>我的房子</Text>
            </View>
            {/* {[...this.state.currentHouse, ...this.state.otherHouse].filter(
              e => e.houseHoldType == '1' && e.status == 3,
            ).length > 0 && this.state.userInfo.user.id ? (
              <View
                className='row'
                style={{ justifyContent: 'center' }}>
                <Text className='more'>房产估值</Text>
                <View
                  style={{ alignContent: 'center', justifyContent: 'center' }}>
                  <Image
                    className='r_img'
                    mode="widthFix"
                    src={rightIcon}
                  />
                </View>
              </View>
            ) : (
              <Text />
            )} */}
          </View>
          {/* {[...this.state.currentHouse, ...this.state.otherHouse].filter(
            e => e.houseHoldType == '1' && e.status == 3,
          ).length <= 0 ? (
            <View className="NohouseBox">
              <View className="box_left">
                <Text className="left_title">
                  查看房屋估值走势
                </Text>
                <Text className="left_desc">
                  看看你的房子值多少钱
                </Text>
                <View className="left_btn">
                  <Text className="btn_text">
                    房产估值
                  </Text>
                </View>
              </View>
              <Image className="box_right" src={NohouseMoneyIcon} />
            </View>
          ) : ( */}
          <View className='moneyBox'>
            <Image mode="widthFix" className='moneyBG' src={myhousemoneyBGIcon} />
            <Swiper autoplay circular className="banner-swiper">
              {/* {[...this.state.currentHouse, ...this.state.otherHouse]
                  .filter(e => e.houseHoldType == '1' && e.status == 3)
                  .map(e => ( */}
              <SwiperItem>
                <View className='houseBoxList'>
                  <Image className='testHouse' src={testHouseIcon} />
                  <View className='testBox'>
                    <Text className='communityName'>
                      {/* {e.communityName} */}小区名称
                    </Text>
                    <Text className='houseArea'>
                      {/* {e.houseArea}m² */}
                      122m²
                    </Text>
                    <Text className='houseMoney'>
                      {/* {(houseSetting.houseMoney * e.houseArea)
                              .toFixed(0)
                              .slice(0, -4)} */}
                      177万
                    </Text>
                  </View>
                </View>
              </SwiperItem>
              {/* ))} */}
            </Swiper>
          </View>
          {/* )} */}
        </View>
      </View>
    );
  }
}

//create by moon https://github.com/creasy2010/moon
